package com.demo.springbootjobcron.controller;

import com.demo.springbootjobcron.job.process.TestProcess;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Hanson
 * @date 2022/9/7 10:35
 */
@Slf4j
@RestController
@RequestMapping("/job")
public class TestController {

    @Autowired
    TestProcess testProcess;

    @GetMapping
    public String job(@RequestParam String jobName) {
        if ("testJob".equals(jobName)) {
            testProcess.process();
        }
        return "成功";
    }
}
